package com.sun.service.impl;

import com.sun.dao.TypeDao;
import com.sun.dto.TypeAndAmount;
import com.sun.pojo.Type;
import com.sun.service.TypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author: glorysun
 * @date: 2020/8/5
 */
@Service
public class TypeServiceImpl implements TypeService {

    @Autowired
    private TypeDao typeDao;

    @Override
    public int insertType(Type type) {
        return typeDao.insertType(type);
    }

    @Override
    public Type selectTypeById(Long id) {
        return typeDao.selectTypeById(id);
    }

    @Override
    public Type selectTypeByName(String name) {
        return typeDao.selectTypeByName(name);
    }

    @Override
    public List<Type> selectTypeList() {
        return typeDao.selectTypeList();
    }

    @Override
    public int updateType(Type type) {
        return typeDao.updateType(type);
    }

    @Override
    public int deleteType(Long id) {
        return typeDao.deleteType(id);
    }

    @Override
    public List<TypeAndAmount> selectTypeAndAmount() {
        return typeDao.selectTypeAndAmount();
    }
}
